
#include <string>
#include <stack>
#include <vector>
using namespace std;

class vertex
{
public:
	float mX, mY, mZ;
    vertex() {mX = mY = mZ = 0; }
};

class LSystem_Info
{
public:
	LSystem_Info(){};

	LSystem_Info(vertex ao_Pos, vertex ao_Dir, float af_Len, int as32_Rot);

    vertex mo_Pos;
    vertex mo_Dir;
    float mo_Len;
	int ms32_Rot;
};

class lsystem
{
public:
	
	std::stack<LSystem_Info> mo_Stack;
    float * mf_Vtx[8];
    int ms32_Vtxcount[8];
    
    float mf_Angle;
    float mf_Length;
    float mf_Genlength;
    int ms32_Axiomcount;
    int ms32_Iterations;
	string mo_Axiom;
    lsystem();
    ~lsystem();
    void generate(string &ao_Source,int au32_MaxIterations);
	void parseString(const string &ao_Axiom,string &ao_Result, int as32_Iteration, int au32_MaxIterations);

	
	void draw();
    void push(LSystem_Info ao_Info);
    LSystem_Info* pop();
    float tick();
	void SetTime(float af_Time);

private :
	float mf_Time;

};
